package com.ruoyi.drinkwater.service.impl;

import java.util.List;
import java.util.UUID;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.drinkwater.mapper.BusWaterDrinksourceInspectionsMapper;
import com.ruoyi.drinkwater.domain.BusWaterDrinksourceInspections;
import com.ruoyi.drinkwater.service.IBusWaterDrinksourceInspectionsService;

/**
 * 饮用水源地巡检记录Service业务层处理
 * 
 * @author maliang
 * @date 2025-11-02
 */
@Service
public class BusWaterDrinksourceInspectionsServiceImpl implements IBusWaterDrinksourceInspectionsService 
{
    @Autowired
    private BusWaterDrinksourceInspectionsMapper busWaterDrinksourceInspectionsMapper;

    /**
     * 查询饮用水源地巡检记录
     * 
     * @param id 饮用水源地巡检记录主键
     * @return 饮用水源地巡检记录
     */
    @Override
    public BusWaterDrinksourceInspections selectBusWaterDrinksourceInspectionsById(String id)
    {
        return busWaterDrinksourceInspectionsMapper.selectBusWaterDrinksourceInspectionsById(id);
    }

    /**
     * 查询饮用水源地巡检记录列表
     * 
     * @param busWaterDrinksourceInspections 饮用水源地巡检记录
     * @return 饮用水源地巡检记录
     */
    @Override
    public List<BusWaterDrinksourceInspections> selectBusWaterDrinksourceInspectionsList(BusWaterDrinksourceInspections busWaterDrinksourceInspections)
    {
        return busWaterDrinksourceInspectionsMapper.selectBusWaterDrinksourceInspectionsList(busWaterDrinksourceInspections);
    }

    /**
     * 新增饮用水源地巡检记录
     * 
     * @param busWaterDrinksourceInspections 饮用水源地巡检记录
     * @return 结果
     */
    @Override
    public int insertBusWaterDrinksourceInspections(BusWaterDrinksourceInspections busWaterDrinksourceInspections)
    {
        busWaterDrinksourceInspections.setId(UUID.randomUUID().toString());
        busWaterDrinksourceInspections.setCreateby(SecurityUtils.getUsername());
        busWaterDrinksourceInspections.setCreatetime(DateUtils.getNowDate());
        return busWaterDrinksourceInspectionsMapper.insertBusWaterDrinksourceInspections(busWaterDrinksourceInspections);
    }

    /**
     * 修改饮用水源地巡检记录
     * 
     * @param busWaterDrinksourceInspections 饮用水源地巡检记录
     * @return 结果
     */
    @Override
    public int updateBusWaterDrinksourceInspections(BusWaterDrinksourceInspections busWaterDrinksourceInspections)
    {
        return busWaterDrinksourceInspectionsMapper.updateBusWaterDrinksourceInspections(busWaterDrinksourceInspections);
    }

    /**
     * 批量删除饮用水源地巡检记录
     * 
     * @param ids 需要删除的饮用水源地巡检记录主键
     * @return 结果
     */
    @Override
    public int deleteBusWaterDrinksourceInspectionsByIds(String[] ids)
    {
        return busWaterDrinksourceInspectionsMapper.deleteBusWaterDrinksourceInspectionsByIds(ids);
    }

    /**
     * 删除饮用水源地巡检记录信息
     * 
     * @param id 饮用水源地巡检记录主键
     * @return 结果
     */
    @Override
    public int deleteBusWaterDrinksourceInspectionsById(String id)
    {
        return busWaterDrinksourceInspectionsMapper.deleteBusWaterDrinksourceInspectionsById(id);
    }
}
